home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / int11.zip / INT.DOC < prev   
Text File  |  1992-03-24  |  15KB  |  310 lines

  1.  
  2.                Documentation for INT.COM version 1.1
  3.  
  4.         INT.COM is Copyright (C) by David Abbott,  August 1990.
  5.  
  6.      This documentation,  with the exception of the disclaimer and
  7.   licence agreement,  is also Copyright (C) by David Abbott 1990-1992
  8.                           All Rights Reserved.
  9.  
  10.  
  11. CONTENTS:
  12.  
  13.     * Warning
  14.     * Disclaimer
  15.     * Introduction
  16.     * Usage
  17.     * Examples
  18.     * Beginner's guide
  19.     * History
  20.     * Bugs
  21.     * Licence agreement
  22.  
  23.  
  24. WARNING:
  25.  
  26.     This software has the ability to call DOS and BIOS routines
  27.     which,   if used incorrectly,  may cause unintentional data
  28.     loss. Be sure you understand exactly what a command will do
  29.     before executing it. The potential to format your hard disk
  30.     with one command is contained herin!
  31.  
  32.  
  33. DISCLAIMER:
  34.  
  35.     The author makes no warranty, either implied or expressed,
  36.     including, without limitation, any warranties with respect
  37.     to the software documented here, its quality, performance,
  38.     or fitness for any particular purpose.   In no event shall
  39.     the author be liable for damage, whether direct, indirect,
  40.     special, incidental, or consequential, that arise from the
  41.     use of or any defect in the software.   The entire risk as
  42.     to the quality and performance of the software is with the
  43.     user.  By using this program, you acknowledge:
  44.     (1) to have read and understood all parts of this
  45.         disclaimer, the warning above,  and of the licence
  46.         agreement appearing at the end of this document, and
  47.     (2) to have agreed with and accepted all of their
  48.         provisions.
  49.  
  50.  
  51.  
  52. INTRODUCTION:
  53.  
  54.     Have you ever wanted to check for a key press in a batch file, without
  55. having the batch file wait for input?  If you have an EGA/VGA colour system,
  56. wouldn't it be nice to be able to have full control over the colours a program
  57. uses,  even if the program does not normally allow this?  Well now, thanks to
  58. INT.COM,  virtually anyone can have this power!  INT.COM is a small but very
  59. powerful utility,  which enables the easy execution of software interrupts
  60. from the DOS command line.  Those users not experienced with software
  61. interrupts or who don't know what a CPU register is may like to read now the
  62. BEGINNER'S GUIDE to INT.COM which appears later in this document.  The rest of
  63. you can continue on here.
  64.  
  65.  
  66. USAGE:
  67.  
  68.               int R N [ah al bh bl ch cl dh dl si di] [;STRING]
  69.         or:   int R N [ax bx cx dx si di] [;STRING]
  70.  
  71.     where R is one of A,a,B,b,C,c,D,or d indicating which general
  72.     purpose register is to be returned as a DOS errorlevel: lower case
  73.     indicating the lower byte, uppercase the high byte (e.g. D returns
  74.     dh, d returns dl).
  75.  
  76.     N is the interrupt number to be called (in hexadecimal)
  77.  
  78.     The first group of optional arguments are 1,2,3, or 4 digit hex
  79.     numbers specifying the contents of 8 or 16-bit registers in the
  80.     order indicated. Thus the following command lines are equivalent:
  81.         int a 12 34 56 07 89
  82.         int a 12 3456 0789
  83.         int a 12 34 56 789
  84.     It is only necessary to supply values up to the last register you
  85.     need to specify.  The remaining registers will be set to zero.
  86.     NOTE: The segment registers cs,ds,es, and ss all point to the
  87.     Program Segment Prefix (PSP).  This can be useful when supplying
  88.     additional data on the command line (see below).
  89.  
  90.     ;STRING is used to supply additional data for some interrupts.  All
  91.     characters appearing after the semi-colon are ignored by INT.COM,
  92.     but are accessible to the interrupt called.  To use this feature,
  93.     all one has to know is that the offset from the start of the PSP to
  94.     the first character of the command tail is 81h.  Thus it is a simple
  95.     matter to count up to the semi-colon and find the offset of the
  96.     extra data. For example,  the following line uses int 21h, function
  97.     9 to write the string "Hello World!" to the screen:
  98.         int a 21 09 00 0000 0000 009c;Hello World!$
  99.     (with the first space after int at offset 81h, Hello World must
  100.     start at offset 9ch,  to which dx is set).
  101.  
  102. NOTE: INT.COM does very little checking of command line syntax.  As long as
  103. the first argument is legal,  and no illegal characters appear before the
  104. semi-colon,  INT.COM will be satisfied.  It is therefore most important that
  105. you check the command line before execution,  or some nasty results may
  106. follow!
  107.  
  108.  
  109. EXAMPLES:
  110.  
  111.     The following examples illustrate the power and convenience of
  112.     INT.COM,  especially when used in batch files.  To get the most
  113.     out of INT.COM,  however,  you will need a reference listing the
  114.     DOS and ROM BIOS interrupts.  There are many books available
  115.     containing this information,  as well as some useful public domain
  116.     and shareware databases.
  117.  
  118.  
  119. * Check to see if ESC key has been pressed,  without waiting.  The first int
  120.   command checks for the presence of a keypress,  the second reads it:
  121. echo off
  122. int a 21 0b
  123. if not errorlevel 1 goto :nokey
  124. int a 21 08
  125. if not errorlevel 28 if errorlevel 27 goto :esc_pressed
  126. rem: The above line tests errorlevel (to which register al was returned) for
  127. rem: the value decimal 27 (ASCII code for ESC).
  128. goto :key_not_esc
  129.  
  130.  
  131. * single line batch file to set new video mode (I call this vmode.bat):
  132. int a 10 00 %1
  133.   This accepts the video mode number in hexadecimal.  Thus to set video mode
  134.   on a CGA to 40x25 16 colour text, use "vmode 6".  For 640x200 16 colour
  135.   graphics on a VGA/EGA, use "vmode E".  Consult your video card's
  136.   documentation to see if there are other useful modes available.  For
  137.   example, a Paradise compatible VGA card can be switched to 132 column text
  138.   with "vmode 55".
  139.  
  140.  
  141. * set VGA/EGA displayable colour 0Eh (yellow) to a different shade of yellow
  142.   from the available palette:
  143. int a 10 1000 37 e
  144.  
  145.  
  146. * set VGA palette colour 0 (black) to very dark blue by specifying RGB values:
  147. int a 10 1010  0000   0 11 0
  148.              col.reg. G B  R  (remember they are in hexadecimal)
  149.   To use this for other colours,  it is helpful to know which palette colour
  150.   registers actually correspond to which displayable colours in the default
  151.   palette selection.  They are as follows:
  152.     displayable colour:  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
  153.     colour from palette: 00,01,02,03,04,05,14,07,38,39,3a,3b,3c,3d,3e,3f
  154.   So to specify the RGB values for yellow, you would need to change register 3e.
  155.  
  156.  
  157. * disable default colour palette/register loading on VGA mode set:
  158. int a 10 12 01 0031
  159.   to re-enable, use:
  160. int a 10 12 00 0031
  161.   This can be very useful after setting precisely the colours you want to use
  162.   in a particular application,  to prevent these colours being reset by the
  163.   application program itself if it resets the video mode.  In this way, you
  164.   can use VGA colours in programs that don't support the VGA (but note that
  165.   some programs which switch video modes during execution rely on default
  166.   loading being enabled,  in which case you could be left with weird colours
  167.   if you use this trick)!
  168.  
  169.  
  170.  
  171. BEGINNER'S GUIDE:
  172.  
  173.         Hidden inside every PC are many small programs which perform tasks
  174. such as reading the keyboard,  setting different colours, changing video
  175. modes,  or writing text to the screen.  These programs are contained in two
  176. places:  the ROM BIOS (Read Only Memory Basic Input Output System) and DOS
  177. (Disk Operating System).  Normally,  one has to write programs in assembly
  178. language or a higher level language to access these operating system routines.
  179. That's because they're called by what are known as software interrupts.  When
  180. a particular interrupt is called, the computer executes the corresponding BIOS
  181. or DOS routine,  and then passes control back to the calling program.  What's
  182. needed, therefore, is a small program which will call the interrupt for us,
  183. and this is exactly what INT.COM does.
  184.  
  185.         INT.COM is a small program which allows software interrupts to be
  186. called directly from the command line,  or from within batch files. Those of
  187. you familiar with the available DO